﻿using System;

namespace ItemQuoteLibrary
{
    public class ItemQuote
    {
        public long ItemNumber { get; set; }            // Item identification number
        public string ItemDescription { get; set; }     // String description of item
        public int Quantity { get; set; }               // Number of items in quote (always >= 1)
        public int UnitPrice { get; set; }              // Price (in cents) per item
        public bool Discounted { get; set; }            // Price reflect a discount?
        public bool InStock { get; set; }               // Item(s) ready to ship?


        public ItemQuote(long itemNumber, String itemDescription,
            int quantity, int unitPrice, Boolean discounted, Boolean inStock)
        {
            ItemNumber = itemNumber;
            ItemDescription = itemDescription;
            Quantity = quantity;
            UnitPrice = unitPrice;
            Discounted = discounted;
            InStock = inStock;
        }

        public override String ToString()
        {
            string EOLN = "\n";
            string value = "Item# = " + ItemNumber + EOLN +
                           "Description = " + ItemDescription + EOLN +
                           "Quantity = " + Quantity + EOLN +
                           "Price (each) = " + UnitPrice + EOLN +
                           "Total Price = " + (Quantity * UnitPrice);            

            if (Discounted)
                value += " (discounted)";
            if (InStock)
                value += EOLN + "In Stock" + EOLN;
            else
                value += EOLN + "Out of Stock" + EOLN;

            return value;
        }
    }
}